package com.zheng.russiaRec.view.components 
{
	
	import com.zheng.russiaRec.view.components.common.GameSprite;
	
	
	/**
	 * @describe  	棋盘ui
	 * @author  	Mr.zheng
	 * @website 	http://blog.sina.com.cn/zihua2007
	 * @time		... 
	 */
	public class UI_Checkerboard extends GameSprite
	{
		
		public function UI_Checkerboard() 
		{
		}
		/**
		 * 画棋盘
		 * @param row	行编号
		 * @param cols	列编号
		 * @param w
		 * @param h
		 */
		public function drawCB(row:int, cols:int, w:int, h:int):void {
			var rec:UI_Rec;
			for (var i:int = 0; i < row; i++)
			{
				for (var j:int = 0; j < cols; j++) 
				{
					rec = new UI_Rec(new RecMc);
					rec.width = w;
					rec.height = h;
					rec.x = i * w;
					rec.y = j * h;
					rec.name = "rec" + i + "_" + j;
					this.addChild(rec);
				}
			}
		}
		
	}
	
}